<?php
//session_start();
require_once("dbconnect.php");

//$exeName=$_SESSION['user'];
//echo $exeName;
$enum=$_GET['enq_num'];
$sql="select * from enquiry where enq_num='$enum';";
echo $sql;
$result=mysql_query($sql) or die(mysql_error());
while($r=mysql_fetch_assoc($result))
	{
	$id=$r['id'];
	$num=$r['enq_num'];
	}




//echo $sql;
//$result=mysql_query($sql)or die("query exicution failure".mysql_error());;



?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="405" border="0" cellpadding="10" cellspacing="1" bgcolor="#C9C9C9">
                                                        <tr>
                                                          <td height="30" colspan="2" align="center" valign="middle" background="../images/table-hed.gif" bgcolor="#EAF1FF">
														  <?php while($line=mysql_fetch_assoc($result))
	{
		
		$exe_id=$line['enq_num'];
	//echo $uid;
		$org=$row['org_name'];
		$division=$line['division'];
		$enqtype=$row['enqiry_type'];
		$duedate=dateconvrt($row['due_date'],1);
		$techbid=$row['technical_bid'];
		$pricebid=$row['price_bid'];
		$prjname=$line['prj_name'];
		$prob=$line['probability'];
		$oppname=$line['opp_name'];
		$exename=$line['exec_name'];
		$currency=$line['quote_currency'];
		$date=$line['current_date'];
		$enqnum=$line['enq_num'];
	
	}


	
function dateconvrt($date,$func) 
{	
if ($func == 1)
{ //insert conversion
list($year, $month, $day) = split('[/.-]', $date);
$date = "$day-$month-$year";
return $date;
}
}?><strong>Enquiry Details</strong></td>
  </tr>
                                                        <tr>
                                                          <td width="176" height="30" align="left" bgcolor="#EAF1FF" class="content"><strong>Executive Id: </strong></td>
                                                          <td width="186" bgcolor="#FFFFFF" class="content" ><?php echo $exe_id;?>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                          <td height="30" align="left" bgcolor="#EAF1FF" class="content"><strong>Organisation name: </strong></td>
                                                          <td bgcolor="#FFFFFF" class="content"><?php echo $org_name;?>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                          <td height="30" align="left" bgcolor="#EAF1FF" class="content"><strong>Division</strong></td>
                                            <td bgcolor="#FFFFFF" class="content"><?php echo $division; ?>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                          <td height="30" align="left" bgcolor="#EAF1FF" class="content"><strong>Name of User: </strong></td>
                                                          <td bgcolor="#FFFFFF" class="content"><?php echo $username;?>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                          <td height="30" align="left" bgcolor="#EAF1FF" class="content"><strong>Enquirytype : </strong></td>
                                                          <td bgcolor="#FFFFFF" class="content"><?php echo $enq_type;?>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                          <td height="30" align="left" bgcolor="#EAF1FF" class="content"><strong>Duedate :</strong></td>
                                                          <td bgcolor="#FFFFFF" class="content"><?php echo $duedate;?>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                          <td height="30" align="left" bgcolor="#EAF1FF" class="content"><strong>Bid Type :</strong></td>
                                                          <td bgcolor="#FFFFFF" class="content"><?php 
					if($techbid==1){echo " Technical Bid ";}
					if(($techbid==1) && ($pricebid==1)) {echo "And";}
					if($pricebid==1){echo " Price Bid ";}
					?>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                          <td height="30" align="left" bgcolor="#EAF1FF" class="content"><strong>Projectname :</strong></td>
                                                          <td bgcolor="#FFFFFF" class="content"><?php echo $prjname;?>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                          <td height="30" align="left" bgcolor="#EAF1FF" class="content"><strong>Probability : </strong></td>
                                                          <td bgcolor="#FFFFFF" class="content"><?php echo $prob;?>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                          <td height="30" align="left" bgcolor="#EAF1FF" class="content"><strong>Oppertunity Name : </strong></td>
                                                          <td bgcolor="#FFFFFF" class="content"><?php echo $oppname;?>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                          <td height="30" align="left" bgcolor="#EAF1FF" class="content"><strong>Executive Name :</strong></td>
                                                          <td bgcolor="#FFFFFF" class="content"><?php echo $exename;?>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                          <td align="left" bgcolor="#EAF1FF" class="content"><strong>Currency : </strong></td>
                    <td align="left" bgcolor="#FFFFFF" class="content"><?php echo $currency ?>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                          <td align="left" bgcolor="#EAF1FF" class="content"><strong>Date:</strong></td>
                                                          <td align="left" bgcolor="#FFFFFF" class="content"><?php echo $date;?></td>
                                                        </tr>
                                                        <tr>
                                                          <td align="left" bgcolor="#EAF1FF" class="content"><strong>Enqnumber:</strong></td>
                                                          <td align="left" bgcolor="#FFFFFF" class="content"><?php echo $enqnum;?></td>
                                                        </tr>
</table>


</body>
</html>
